<?php

$router = new \Phalcon\Mvc\Router();
$router->add("/:controller/:action", array(
            'controller' => 1,
            'action'     => 2
                )
        )
        ->convert(
                'action', function ($action)
        {
            return str_replace('-', '', $action);
        }
);
$router->add("/backend", array(
    'module'    => 'backend',
    'namespace' => 'ChanTienGioi\Backend\Controllers',
        )
);
$router->add("/backend/:controller", array(
    'module'     => 'backend',
    'namespace'  => 'ChanTienGioi\Backend\Controllers',
    'controller' => 1,
    'action'     => "index"
        )
);
$router->add("/backend/:controller/:action", array(
            'module'     => 'backend',
            'namespace'  => 'ChanTienGioi\Backend\Controllers',
            'controller' => 1,
            'action'     => 2
                )
        )
        ->convert(
                'action', function ($action)
        {
            return str_replace('-', '', $action);
        }
);
$router->setDefaultModule("frontend");
$router->setDefaultNamespace("ChanTienGioi\Frontend\Controllers");
$router->removeExtraSlashes(true);
$router->handle();
return $router;
